from django.urls import path,re_path
from . import views
from ETP.view import user_login_views as userLoginViews
from ETP.view import product_views as productViews
app_name='ETP'

urlpatterns = [

    #登录登出
    re_path(r'^login/$', userLoginViews.login, name='login'),



    #User相关请求


    #Product相关的请求
    re_path(r'^products/$', views.products, name='products'),
    re_path(r'^product/(?P<product_id>\d+)/$', views.product, name='product'),
    re_path(r'^new_product/$', views.new_product, name='new_product'),
    re_path(r'^edit_product/(?P<product_id>\d+)/$', views.edit_product, name='edit_product'),
    re_path(r'^delete_product/(?P<product_id>\d+)/$', views.delete_product, name='delete_product'),

    re_path(r'^products_new/$', productViews.products_new, name='products_new'),
    re_path(r'^product_new/(?P<product_id>\d+)/$', productViews.product_new, name='product_new'),
    re_path(r'^createProduct/$', productViews.createProduct, name='createProduct'),


    re_path(r'^getParticipant/$', views.getUsers, name='getUsers'),

    #Job相关的请求
    re_path(r'^new_job/(?P<product_id>\d+)/$', views.new_job, name='new_job'),
    re_path(r'^edit_job/(?P<job_id>\d+)/$', views.edit_job, name='edit_job'),
    re_path(r'^delete_job/(?P<job_id>\d+)/$', views.delete_job, name='delete_job'),
    re_path(r'^job/(?P<job_id>\d+)/$', views.job, name='job'),

    #Suite相关的请求
    re_path(r'^new_suite/(?P<job_id>\d+)/$', views.new_suite, name='new_suite'),
    re_path(r'^suite/(?P<suite_id>\d+)/$', views.suite, name='suite'),
    re_path(r'^edit_suite/(?P<suite_id>\d+)/$', views.edit_suite, name='edit_suite'),
    re_path(r'^delete_suite/(?P<suite_id>\d+)/$', views.delete_suite, name='delete_suite'),

    #Step相关的请求
    re_path(r'^new_apistep/(?P<suite_id>\d+)/$', views.new_apistep, name='new_apistep'),
    re_path(r'^edit_apistep/(?P<step_id>\d+)/$', views.edit_apistep, name='edit_apistep'),
    re_path(r'^new_uistep/(?P<suite_id>\d+)/$', views.new_uistep, name='new_uistep'),
    re_path(r'^edit_uistep/(?P<step_id>\d+)/$', views.edit_uistep, name='edit_uistep'),
    re_path(r'^delete_step/(?P<step_id>\d+)/$', views.delete_step, name='delete_step'),

    re_path(r'^run_suite/(?P<suite_id>\d+)/$', views.run_suite, name='run_suite'),
    #re_path(r'^run_job/(?P<job_id>\d+)/$',view.run_job,name='run_job'),

    #celery异步请求demo
    re_path(r'^runHello/$', views.runHello, name='runHello'),
]